﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace JSOCTNet.BIZ
{
    public class JsonHelper
    {
        public static T GetModel<T>(string json) where T:new ()
        {
            T obj = new T();
            obj = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(json);
            return obj;
        }

        public static string GetJson(object obj)
        {
            string json = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
            return json;
        }
    }
}
